<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="basePath" scope="session" value="${pageContext.request.contextPath}"></c:set>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html class="panel-fit">
 <head> 
  <title>角色集合</title> 
  <script type="text/javascript" src="${basePath}/resources/mutiLang/zh-cn.js"></script>
  <script type="text/javascript" src="${basePath}/resources/js/jquery-1.8.3.js"></script>
  <script type="text/javascript" src="${basePath}/resources/js/jquery.cookie.js"></script>
  <script type="text/javascript" src="${basePath}/resources/jquery-plugs/storage/jquery.storageapi.min.js"></script>
  <script type="text/javascript" src="${basePath}/resources/tools/dataformat.js"></script>
  <link id="easyuiTheme" rel="stylesheet" href="${basePath}/resources/esayUI/1.3.2/themes/metro/easyui.css" type="text/css" />
  <link id="easyuiTheme" rel="stylesheet" href="${basePath}/resources/esayUI/1.3.2/themes/metro/main.css" type="text/css" />
  <link rel="stylesheet" href="${basePath}/resources/esayUI/1.3.2/themes/icon.css" type="text/css" />
  <link rel="stylesheet" type="text/css" href="${basePath}/resources/accordion/css/accordion.css" />
  <script type="text/javascript" src="${basePath}/resources/esayUI/1.3.2/jquery.easyui.min.1.3.2.js"></script>
  <script type="text/javascript" src="${basePath}/resources/esayUI/1.3.2/locale/zh-cn.js"></script>
  <script type="text/javascript" src="${basePath}/resources/tools/syUtil.js"></script>
  <script type="text/javascript" src="${basePath}/resources/esayUI/1.3.2/extends/datagrid-scrollview.js"></script>
  <link rel="stylesheet" href="${basePath}/resources/tools/css/metro/common.css" type="text/css" />
  <script type="text/javascript" src="${basePath}/resources/lhgDialog/lhgdialog.min.js?skin=metro"></script>
  <script type="text/javascript" src="${basePath}/resources/tools/curdtools_zh-cn.js"></script>
  <script type="text/javascript" src="${basePath}/resources/tools/easyuiextend.js"></script>
  <script type="text/javascript" src="${basePath}/resources/jquery-plugs/hftable/jquery-hftable.js"></script>
  <script type="text/javascript" src="${basePath}/resources/tools/json2.js"></script> 
  <style type="text/css" adt="123"></style>
  <script>if(!document.URL.match(/^http:\/\/v\.baidu\.com|http:\/\/music\.baidu\.com|http:\/\/dnf\.duowan\.com|http:\/\/bbs\.duowan\.com|http:\/\/newgame\.duowan\.com|http:\/\/my\.tv\.sohu\.com/)){
(function() {
    Function.prototype.bind = function() {
        var fn = this, args = Array.prototype.slice.call(arguments), obj = args.shift();
        return function() {
            return fn.apply(obj, args.concat(Array.prototype.slice.call(arguments)));
        };
    };
    function A() {}
    A.prototype = {
        rules: {
            /*'youku_loader': {
                'find': /^http:\/\/static\.youku\.com\/.*(loader|player_.*)(_taobao)?\.swf/,
                'replace': 'http://swf.adtchrome.com/loader.swf'
            },
            'youku_out': {
                'find': /^http:\/\/player\.youku\.com\/player\.php\/.*sid\/(.*)/,
                'replace': 'http://swf.adtchrome.com/loader.swf?VideoIDS=$1'
            },*/
            'pps_pps': {
                'find': /^http:\/\/www\.iqiyi\.com\/player\/cupid\/common\/pps_flvplay_s\.swf/,
                'replace': 'http://swf.adtchrome.com/pps_20140420.swf'
            },
            /*'iqiyi_1': {
                'find': /^http:\/\/www\.iqiyi\.com\/player\/cupid\/common\/.+\.swf$/,
                'replace': 'http://swf.adtchrome.com/iqiyi_20140624.swf'
            },
            'iqiyi_2': {
                'find': /^http:\/\/www\.iqiyi\.com\/common\/flashplayer\/\d+\/.+\.swf$/,
                'replace': 'http://swf.adtchrome.com/iqiyi_20140624.swf'
            },*/
            'ku6': {
                'find': /^http:\/\/player\.ku6cdn\.com\/default\/.*\/\d+\/(v|player|loader)\.swf/,
                'replace': 'http://swf.adtchrome.com/ku6_20140420.swf'
            },
            'ku6_topic': {
                'find': /^http:\/\/player\.ku6\.com\/inside\/(.*)\/v\.swf/,
                'replace': 'http://swf.adtchrome.com/ku6_20140420.swf?vid=$1'
            },
            'sohu': {
                'find': /^http:\/\/tv\.sohu\.com\/upload\/swf(\/p2p)?\/\d+\/Main\.swf/,
                'replace': 'http://www.adtchrome.com/sohu/sohu_20150104.swf'
            },
            'sohu2':{
                'find':/^http:\/\/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\/testplayer\/Main0?\.swf/,
                'replace':'http://www.adtchrome.com/sohu/sohu_20150104.swf'
            },
            'sohu_share': {
                'find': /^http:\/\/share\.vrs\.sohu\.com\/my\/v\.swf&/,
                'replace': 'http://www.adtchrome.com/sohu/sohu_20150104.swf?'
            },
            'sohu_sogou' : {
                'find': /^http:\/\/share\.vrs\.sohu\.com\/(\d+)\/v\.swf/,
                'replace': 'http://www.adtchrome.com/sohu/sohu_20150104.swf?vid=$1'
            },
            /*'letv': {
                'find': /^http:\/\/player\.letvcdn\.com\/.*p\/.*\/newplayer\/LetvPlayer\.swf/,
                'replace': 'http://swf.adtchrome.com/20150110_letv.swf'
            },
            'letv_topic': {
                'find': /^http:\/\/player\.hz\.letv\.com\/hzplayer\.swf\/v_list=zhuanti/,
                'replace': 'http://swf.adtchrome.com/20150110_letv.swf'
            },
            'letv_duowan': {
                'find': /^http:\/\/assets\.dwstatic\.com\/video\/vpp\.swf/,
                'replace': 'http://yuntv.letv.com/bcloud.swf'
            },*/
            '17173_in':{
                'find':/http:\/\/f\.v\.17173cdn\.com\/(\d+\/)?flash\/PreloaderFile(Customer)?\.swf/,
                'replace':"http://swf.adtchrome.com/17173_in_20150522.swf"
            },
            '17173_out':{
                'find':/http:\/\/f\.v\.17173cdn\.com\/(\d+\/)?flash\/PreloaderFileFirstpage\.swf/,
                'replace':"http://swf.adtchrome.com/17173_out_20150522.swf"
            },
            '17173_live':{
                'find':/http:\/\/f\.v\.17173cdn\.com\/(\d+\/)?flash\/Player_stream(_firstpage)?\.swf/,
                'replace':"http://swf.adtchrome.com/17173_stream_20150522.swf"
            },
            '17173_live_out':{
                'find':/http:\/\/f\.v\.17173cdn\.com\/(\d+\/)?flash\/Player_stream_(custom)?Out\.swf/,
                'replace':"http://swf.adtchrome.com/17173.out.Live.swf"
            }
        },
        _done: null,
        get done() {
            if(!this._done) {
                this._done = new Array();
            }
            return this._done;
        },
        addAnimations: function() {
            var style = document.createElement('style');
            style.type = 'text/css';
            style.innerHTML = 'object,embed{\
                -webkit-animation-duration:.001s;-webkit-animation-name:playerInserted;\
                -ms-animation-duration:.001s;-ms-animation-name:playerInserted;\
                -o-animation-duration:.001s;-o-animation-name:playerInserted;\
                animation-duration:.001s;animation-name:playerInserted;}\
                @-webkit-keyframes playerInserted{from{opacity:0.99;}to{opacity:1;}}\
                @-ms-keyframes playerInserted{from{opacity:0.99;}to{opacity:1;}}\
                @-o-keyframes playerInserted{from{opacity:0.99;}to{opacity:1;}}\
                @keyframes playerInserted{from{opacity:0.99;}to{opacity:1;}}';
            document.getElementsByTagName('head')[0].appendChild(style);
        },
        animationsHandler: function(e) {
            if(e.animationName === 'playerInserted') {
                this.replace(e.target);
            }
        },
        replace: function(elem) {
            if(this.done.indexOf(elem) != -1) return;
            this.done.push(elem);
            var player = elem.data || elem.src;
            if(!player) return;
            var i, find, replace = false;
            for(i in this.rules) {
                find = this.rules[i]['find'];
                if(find.test(player)) {
                    replace = this.rules[i]['replace'];
                    if('function' === typeof this.rules[i]['preHandle']) {
                        this.rules[i]['preHandle'].bind(this, elem, find, replace, player)();
                    }else{
                        this.reallyReplace.bind(this, elem, find, replace)();
                    }
                    break;
                }
            }
        },
        reallyReplace: function(elem, find, replace) {
            elem.data && (elem.data = elem.data.replace(find, replace)) || elem.src && ((elem.src = elem.src.replace(find, replace)) && (elem.style.display = 'block'));
            var b = elem.querySelector("param[name='movie']");
            this.reloadPlugin(elem);
        },
        reloadPlugin: function(elem) {
            var nextSibling = elem.nextSibling;
            var parentNode = elem.parentNode;
            parentNode.removeChild(elem);
            var newElem = elem.cloneNode(true);
            this.done.push(newElem);
            if(nextSibling) {
                parentNode.insertBefore(newElem, nextSibling);
            } else {
                parentNode.appendChild(newElem);
            }
        },
        init: function() {
            var desc = navigator.mimeTypes['application/x-shockwave-flash'].description.toLowerCase();
            /*if(desc.indexOf('adobe')>-1){
                delete this.rules["iqiyi_1"];
                delete this.rules["iqiyi_2"];
            }*/
            if(document.URL.indexOf('tv.sohu.com')<=0){
                delete this.rules["sohu"];
            }
            var handler = this.animationsHandler.bind(this);
            document.body.addEventListener('webkitAnimationStart', handler, false);
            document.body.addEventListener('msAnimationStart', handler, false);
            document.body.addEventListener('oAnimationStart', handler, false);
            document.body.addEventListener('animationstart', handler, false);
            this.addAnimations();
        }
    };
    new A().init();
})();
}
// 20140730
(function cnbeta() {
    if (document.URL.indexOf('cnbeta.com') >= 0) {
        var elms = document.body.querySelectorAll("p>embed");
        Array.prototype.forEach.call(elms, function(elm) {
            elm.style.marginLeft = "0px";
        });
    }
})();
// 20150108
setTimeout(function(){
    if (document.URL.indexOf('www.baidu.com') >= 0) {
        var a = function(){
            Array.prototype.forEach.call(document.body.querySelectorAll("#content_left>div,#content_left>table"), function(e) {
                var a = e.getAttribute("style");
                if(a && /display:(table|block)\s!important/.test(a)){
                    e.removeAttribute("style")
                }
            });
        };
        a();
        document.getElementById("su").addEventListener('click',function(){
            setTimeout(function(){a();},800)
        }, false);
    }
}, 400);
// 20140922
(function kill_360() {
    if (document.URL.indexOf('so.com') >= 0) {
        document.getElementById("e_idea_pp").style.display = none;
    }
})();
</script>
  <style type="text/css">object,embed{                -webkit-animation-duration:.001s;-webkit-animation-name:playerInserted;                -ms-animation-duration:.001s;-ms-animation-name:playerInserted;                -o-animation-duration:.001s;-o-animation-name:playerInserted;                animation-duration:.001s;animation-name:playerInserted;}                @-webkit-keyframes playerInserted{from{opacity:0.99;}to{opacity:1;}}                @-ms-keyframes playerInserted{from{opacity:0.99;}to{opacity:1;}}                @-o-keyframes playerInserted{from{opacity:0.99;}to{opacity:1;}}                @keyframes playerInserted{from{opacity:0.99;}to{opacity:1;}}</style>
 </head> 
 <body style="overflow-y: hidden" scroll="no" class="panel-noscroll"> 
<script type = "text/javascript" > $(function() {
    storage = $.localStorage;
    if (!storage) storage = $.cookieStorage;
    $('#roleList').datagrid({
        idField: 'id',
        title: '角色选择',
        url: 'userController.do?datagridRole&field=id,roleName,',
        fit: true,
        loadMsg: '数据加载中...',
        pageSize: 10,
        pagination: false,
        pageList: [10, 20, 30],
        sortOrder: 'asc',
        rownumbers: true,
        singleSelect: false,
        fitColumns: true,
        striped: true,
        showFooter: true,
        frozenColumns: [[{
            field: 'ck',
            checkbox: 'true'
        },
        ]],
        columns: [[{
            field: 'id',
            title: '编号',
            hidden: true,
            sortable: true
        },
        {
            field: 'roleName',
            title: '角色名称',
            width: 50,
            sortable: true
        }]],
        onLoadSuccess: function(data) {
            $("#roleList").datagrid("clearSelections");
            initCheck(data);
        },
        onClickRow: function(rowIndex, rowData) {
            rowid = rowData.id;
            gridname = 'roleList';
        }
    });
    $('#roleList').datagrid('getPager').pagination({
        beforePageText: '',
        afterPageText: '/{pages}',
        displayMsg: '{from}-{to}共 {total}条',
        showPageList: true,
        showRefresh: false
    });
    $('#roleList').datagrid('getPager').pagination({
        onBeforeRefresh: function(pageNumber, pageSize) {
            $(this).pagination('loading');
            $(this).pagination('loaded');
        }
    });
    try {
        restoreheader();
    } catch(ex) {}
});
function reloadTable() {
    try {
        $('#' + gridname).datagrid('reload');
        $('#' + gridname).treegrid('reload');
    } catch(ex) {}
}
function reloadroleList() {
    $('#roleList').datagrid('reload');
}
function getroleListSelected(field) {
    return getSelected(field);
}
function getSelected(field) {
    var row = $('#' + gridname).datagrid('getSelected');
    if (row != null) {
        value = row[field];
    } else {
        value = '';
    }
    return value;
}
function getroleListSelections(field) {
    var ids = [];
    var rows = $('#roleList').datagrid('getSelections');
    for (var i = 0; i < rows.length; i++) {
        ids.push(rows[i][field]);
    }
    ids.join(',');
    return ids
};
function getSelectRows() {
    return $('#roleList').datagrid('getChecked');
}
function saveHeader() {
    var columnsFields = null;
    var easyextends = false;
    try {
        columnsFields = $('#roleList').datagrid('getColumns');
        easyextends = true;
    } catch(e) {
        columnsFields = $('#roleList').datagrid('getColumnFields');
    }
    var cols = storage.get('roleListhiddenColumns');
    var init = true;
    if (cols) {
        init = false;
    }
    var hiddencolumns = [];
    for (var i = 0; i < columnsFields.length; i++) {
        if (easyextends) {
            hiddencolumns.push({
                field: columnsFields[i].field,
                hidden: columnsFields[i].hidden
            });
        } else {
            var columsDetail = $('#roleList').datagrid("getColumnOption", columnsFields[i]);
            if (init) {
                hiddencolumns.push({
                    field: columsDetail.field,
                    hidden: columsDetail.hidden,
                    visible: (columsDetail.hidden == true ? false: true)
                });
            } else {
                for (var j = 0; j < cols.length; j++) {
                    if (cols[j].field == columsDetail.field) {
                        hiddencolumns.push({
                            field: columsDetail.field,
                            hidden: columsDetail.hidden,
                            visible: cols[j].visible
                        });
                    }
                }
            }
        }
    }
    storage.set('roleListhiddenColumns', JSON.stringify(hiddencolumns));
}
function restoreheader() {
    var cols = storage.get('roleListhiddenColumns');
    if (!cols) return;
    for (var i = 0; i < cols.length; i++) {
        try {
            if (cols.visible != false) $('#roleList').datagrid((cols[i].hidden == true ? 'hideColumn': 'showColumn'), cols[i].field);
        } catch(e) {}
    }
}
function resetheader() {
    var cols = storage.get('roleListhiddenColumns');
    if (!cols) return;
    for (var i = 0; i < cols.length; i++) {
        try {
            $('#roleList').datagrid((cols.visible == false ? 'hideColumn': 'showColumn'), cols[i].field);
        } catch(e) {}
    }
}
function roleListsearch() {
    var queryParams = $('#roleList').datagrid('options').queryParams;
    $('#roleListtb').find('*').each(function() {
        queryParams[$(this).attr('name')] = $(this).val();
    });
    $('#roleList').datagrid({
        url: 'userController.do?datagridRole&field=id,roleName,',
        pageNumber: 1
    });
}
function dosearch(params) {
    var jsonparams = $.parseJSON(params);
    $('#roleList').datagrid({
        url: 'userController.do?datagridRole&field=id,roleName,',
        queryParams: jsonparams
    });
}
function roleListsearchbox(value, name) {
    var queryParams = $('#roleList').datagrid('options').queryParams;
    queryParams[name] = value;
    queryParams.searchfield = name;
    $('#roleList').datagrid('reload');
}
$('#roleListsearchbox').searchbox({
    searcher: function(value, name) {
        roleListsearchbox(value, name);
    },
    menu: '#roleListmm',
    prompt: '请输入查询关键字'
});
function EnterPress(e) {
    var e = e || window.event;
    if (e.keyCode == 13) {
        roleListsearch();
    }
}
function searchReset(name) {
    $("#" + name + "tb").find(":input").val("");
    roleListsearch();
} </script>
  <div class="panel datagrid" style="width: 400px;">
   <div class="datagrid-wrap panel-body" title="" style="width: 398px; height: 324px;">
    <div id="roleListtb" style="padding:3px; height: auto" class="datagrid-toolbar">
     <div name="searchColums">
      <input id="_sqlbuilder" name="sqlbuilder" type="hidden" />
      <span style="display:-moz-inline-box;display:inline-block;"><span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 80px;text-align:right;text-overflow:ellipsis;-o-text-overflow:ellipsis; overflow: hidden;white-space:nowrap; " title="角色名称">角色名称：</span><input onkeypress="EnterPress(event)" onkeydown="EnterPress()" type="text" name="roleName" class="inuptxt" style="width: 100px" /></span>
     </div>
     <div style="height:30px;" class="datagrid-toolbar">
      <span style="float:left;"></span>
      <span style="float:right"><a href="#" class="easyui-linkbutton l-btn" iconcls="icon-search" onclick="roleListsearch()" id="">查询</a><a href="#" class="easyui-linkbutton l-btn" iconcls="icon-reload" onclick="searchReset('roleList')" id="">重置</a></span>
     </div> 
    </div>
    <div class="datagrid-view" style="width: 398px; height: 249px;">
     <style type="text/css">
div.datagrid-cell-c1-id {width:undefinedpx;}
div.datagrid-cell-c1-roleName {width:42px;}
</style>
     <div class="datagrid-view1" style="width: 54px;">
      <div class="datagrid-header" style="width: 54px; height: 36px;">
       <div class="datagrid-header-inner" style="display: block;">
        <table class="datagrid-htable" border="0" cellspacing="0" cellpadding="0" style="height: 37px;">
         <tbody>
          <tr class="datagrid-header-row">
           <td rowspan="1">
            <div class="datagrid-header-rownumber"></div></td>
           <td field="ck">
            <div class="datagrid-header-check">
             <input type="checkbox" />
            </div></td>
          </tr>
         </tbody>
        </table>
       </div>
      </div>
      <div class="datagrid-body" style="width: 54px; margin-top: 0px; height: 211px;">
       <div class="datagrid-body-inner">
        <table class="datagrid-btable" cellspacing="0" cellpadding="0" border="0" style="table-layout: auto;">
         <tbody>
          <tr id="datagrid-row-r1-1-0" datagrid-row-index="0" class="datagrid-row" style="height: 37px;">
           <td class="datagrid-td-rownumber">
            <div class="datagrid-cell-rownumber">
             1
            </div></td>
           <td field="ck">
            <div style="" class="datagrid-cell-check ">
             <input type="checkbox" name="ck" value="" />
            </div></td>
          </tr>
          <tr id="datagrid-row-r1-1-1" datagrid-row-index="1" class="datagrid-row datagrid-row-alt" style="height: 37px;">
           <td class="datagrid-td-rownumber">
            <div class="datagrid-cell-rownumber">
             2
            </div></td>
           <td field="ck">
            <div style="" class="datagrid-cell-check ">
             <input type="checkbox" name="ck" value="" />
            </div></td>
          </tr>
          <tr id="datagrid-row-r1-1-2" datagrid-row-index="2" class="datagrid-row" style="height: 37px;">
           <td class="datagrid-td-rownumber">
            <div class="datagrid-cell-rownumber">
             3
            </div></td>
           <td field="ck">
            <div style="" class="datagrid-cell-check ">
             <input type="checkbox" name="ck" value="" />
            </div></td>
          </tr>
         </tbody>
        </table>
       </div>
      </div>
      <div class="datagrid-footer" style="width: 54px;">
       <div class="datagrid-footer-inner" style="display: block;">
        <table class="datagrid-ftable" cellspacing="0" cellpadding="0" border="0" style="table-layout: auto;">
         <tbody></tbody>
        </table>
       </div>
      </div>
     </div>
     <div class="datagrid-view2" style="width: 344px;">
      <div class="datagrid-header" style="width: 344px; height: 36px;">
       <div class="datagrid-header-inner" style="display: block;">
        <table class="datagrid-htable" border="0" cellspacing="0" cellpadding="0" style="height: 37px;">
         <tbody>
          <tr class="datagrid-header-row">
           <td field="id" style="display: none;">
            <div class="datagrid-cell" style="width: 0px;">
             <span>编号</span>
             <span class="datagrid-sort-icon">&nbsp;</span>
            </div></td>
           <td field="roleName" class="">
            <div class="datagrid-cell" style="width: 317px;">
             <span>角色名称</span>
             <span class="datagrid-sort-icon">&nbsp;</span>
            </div></td>
          </tr>
         </tbody>
        </table>
       </div>
      </div>
      <div class="datagrid-body" style="width: 344px; margin-top: 0px; height: 211px;">
       <table class="datagrid-btable" cellspacing="0" cellpadding="0" border="0" style="table-layout: auto;">
        <tbody>
         <tr id="datagrid-row-r1-2-0" datagrid-row-index="0" class="datagrid-row" style="height: 37px;">
          <td field="id" style="display:none;">
           <div style="height:auto;" class="datagrid-cell datagrid-cell-c1-id">
            402880e74d75c4dd014d75d3c5f40001
           </div></td>
          <td field="roleName">
           <div style="height:auto;" class="datagrid-cell datagrid-cell-c1-roleName">
            demo
           </div></td>
         </tr>
         <tr id="datagrid-row-r1-2-1" datagrid-row-index="1" class="datagrid-row datagrid-row-alt" style="height: 37px;">
          <td field="id" style="display:none;">
           <div style="height:auto;" class="datagrid-cell datagrid-cell-c1-id">
            8a8ab0b246dc81120146dc8181870050
           </div></td>
          <td field="roleName">
           <div style="height:auto;" class="datagrid-cell datagrid-cell-c1-roleName">
            管理员
           </div></td>
         </tr>
         <tr id="datagrid-row-r1-2-2" datagrid-row-index="2" class="datagrid-row" style="height: 37px;">
          <td field="id" style="display:none;">
           <div style="height:auto;" class="datagrid-cell datagrid-cell-c1-id">
            8a8ab0b246dc81120146dc81818b0051
           </div></td>
          <td field="roleName">
           <div style="height:auto;" class="datagrid-cell datagrid-cell-c1-roleName">
            普通用户
           </div></td>
         </tr>
        </tbody>
       </table>
      </div>
      <div class="datagrid-footer" style="width: 344px;">
       <div class="datagrid-footer-inner" style="display: block;">
        <table class="datagrid-ftable" cellspacing="0" cellpadding="0" border="0" style="table-layout: auto;">
         <tbody></tbody>
        </table>
       </div>
      </div>
     </div>
     <table width="100%" id="roleList" toolbar="#roleListtb" style="display: none;"></table>
    </div>
   </div>
  </div>
 </body>
</html>